-
Notifications
You must be signed in to change notification settings - Fork 873
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't use CONTENT_SETTING_DEFAULT for FP setting #5879
Conversation
a70dc6e
to
ab455e7
Compare
// With DEFAULT, it always use global FP setting. | ||
// But we want DEFAULT as a standard FP blocking instead of fallback to | ||
// global settings. | ||
// As a workaround, picked CONTENT_SETTING_ASK to store it persistently. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this fix is best way.. Changed to use secondary pattern.
ab455e7
to
ccb0267
Compare
if (balanced_setting == CONTENT_SETTING_BLOCK) { | ||
if (setting == CONTENT_SETTING_BLOCK) { | ||
// There is no way to determine whether site setting is balanced or | ||
// aggressive(block) here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know how to determine whether site setting is balanced or aggressive in here. fixed.
If global setting is aggressive(BLOCK) and |balanced_setting| is also BLOCK, it's ambiguous to determine where BLOCK comes from global or site's balanced fp value.
2018c8d
to
dc5511f
Compare
41ed463
to
667490f
Compare
primary_pattern, ContentSettingsPattern::Wildcard(), | ||
ContentSettingsType::PLUGINS, kFingerprintingV2, | ||
GetDefaultAllowFromControlType(type)); | ||
HostContentSettingsMapFactory::GetForProfile(profile)-> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do not need two rules for this. The secondary pattern is either "balanced" or it's a wildcard. It should never be both.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed to have one fp rule for one url. - e2213b5817d4dc3b3c12a12da47bff69295034f4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused, it's still setting two rules here. We should never be setting both wildcard and balanced for the secondary pattern
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, this PR only set one rule for one url but two patterns.
If current www.brave.com has balanced, only one rule (second - balanced
) is stored.
and if user set other rule(allow), it will have only one rule (second - *
) is stored.
When new rule is stored previous balanced rule is not deleted automatically because both are different rule. So, clearing step is needed.
If we don't clear here, prefs could have two rules.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I see. I missed the comment
667490f
to
e2213b5
Compare
@@ -54,4 +56,9 @@ void MigrateObsoleteProfilePrefs(Profile* profile) { | |||
// Added 1/2020 | |||
brave_wallet::MigrateBraveWalletPrefs(profile); | |||
#endif | |||
|
|||
// Added 6/2020 | |||
brave_shields::MigrateFingerprintingPrefsFromV1ToV2( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we intentionally did not migrate settings cc @pes10k @pilgrim-brave
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Migration commit is removed from this PR.
2d7b0f6
to
f6d0f75
Compare
ContentSettingsPattern::FromString("https://balanced/*"); | ||
|
||
if (type != ControlType::DEFAULT) { | ||
content_setting = (type == ControlType::ALLOW) ? CONTENT_SETTING_ALLOW |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we have helpers for this GetDefaultAllowFromControlType
and GetDefaultBlockFromControlType
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
f6d0f75
to
1ab8233
Compare
CONTENT_SETTING_DEFAULT means deleting the current content setting. With DEFAULT, it always use global FP setting. But we want DEFAULT as a standard FP blocking instead of fallback to global settings. Use secondary pattern for marking setting as balanced mode.
1ab8233
to
702a17b
Compare
Merged because only unrelated |
Verification passed on
|
CONTENT_SETTING_DEFAULT means deleting the current content setting.
With DEFAULT, it always use global FP setting.
But we want DEFAULT as a standard FP blocking instead of fallback to
global settings. Use secondary pattern for marking setting as balanced mode.
Resolves brave/brave-browser#10285
Submitter Checklist:
npm run lint
)git rebase master
(if needed).git rebase -i
to squash commits (if needed).Test Plan:
See STR in the issue
Reviewer Checklist:
After-merge Checklist:
changes has landed on.